class Node:
    def __init__(self, value, left, right) -> None:
        self.value = value
        self.left = left
        self.right = right


def generateTree(ary, start, end) -> Node:

    if start == end:
        return Node(ary[start], None, None)

    midIndex = (start+end) >> 1
    left = generateTree(ary, start, midIndex-1)
    right = generateTree(ary, midIndex+1, end)
    ans = Node(ary[midIndex], left, right)
    return ans


def dfs(node: Node, target, path) -> str:
    if node.value == target:
        path += 'Y'
    elif node.value > target:
        if node.left == None:
            path += 'N'

        else:
            path += 'L'
            path = dfs(node.left, target, path)
    else:
        if node.right == None:
            path += 'N'
        else:
            path += 'R'
            path = dfs(node.right, target, path)
    return path


# 处理输入
nums = list(map(int, input().split()))
target = int(input())

# 构造树
nums.sort()
length = len(nums)
root = generateTree(nums, 0, length-1)

# 深度优先搜索
path = 'S'
path = dfs(root, target, path)
print(path)
